package nowcoder;

import java.util.Scanner;

public class 和为定值的组合 {
    static int length;

    static void findCombination(int n, int m, int flagI[]) {
        if (n < 1 || m < 1) {
            return;
        }
        if (n > m) {
            n = m;
        }
        if (n == m) {
            flagI[n - 1] = 1;
            for (int i = 0; i < length; i++) {
                if (flagI[i] == 1) {
                    System.out.print(i + 1 + " ");
                }

            }
            System.out.println();
            flagI[n - 1] = 0;
        }

        flagI[n - 1] = 1;
        findCombination(n - 1, m - n, flagI);

        flagI[n - 1] = 0;
        findCombination(n - 1, m, flagI);
    }

    public static void main(String[] args) {
        int n, m;
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        m = s.nextInt();
        length = n;
        int[] flag = new int[n];
        findCombination(n, m, flag);
    }
}